﻿package plugin.social
{
    import flash.filters.*;
    import flash.utils.*;

    public class SocialFilter extends Object
    {
        private var arrDic:Dictionary;
        private var colorFilter:ColorMatrixFilter;
        public static const GRAVE:int = 0;
        public static const LIGHT:int = 100;
        public static const LIGHTGRAVE:int = 101;

        public function SocialFilter()
        {
            this.arrDic = new Dictionary();
            this.arrDic[GRAVE] = [0.3086, 0.6094, 0.082, 0, 0, 0.3086, 0.6094, 0.082, 0, 0, 0.3086, 0.6094, 0.082, 0, 0, 0, 0, 0, 1, 0];
            this.arrDic[LIGHT] = [1.5, 0, 0, 0, 0, 0, 1.5, 0, 0, 0, 0, 0, 1.5, 0, 0, 0, 0, 0, 1, 0];
            return;
        }// end function

        public function getColorFilter(param1:int) : ColorMatrixFilter
        {
            if (this.colorFilter == null)
            {
                this.colorFilter = new ColorMatrixFilter(this.arrDic[param1]);
            }
            else
            {
                this.colorFilter.matrix = this.arrDic[param1];
            }
            return this.colorFilter;
        }// end function

    }
}
